package com.slipper.system.schedule.front;

import java.util.List;

import com.slipper.common.bo.Result;
import com.slipper.common.util.ResultUtil;
import com.slipper.system.schedule.service.ScheduleService;

import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import com.slipper.system.api.schedule.bo.ScheduleBO;
import com.slipper.system.api.schedule.service.IScheduleSv;

@RestController
public class ScheduleSv implements IScheduleSv {
    @Resource
    private ScheduleService scheduleService;
    
    @Override
    public Result<ScheduleBO> queryBy(ScheduleBO bo){
        return ResultUtil.successResult(scheduleService.queryBy(bo));
    }
    
    @Override
    public Result<List<ScheduleBO>> queryPage(ScheduleBO bo){
        return ResultUtil.successResult(scheduleService.queryPage(bo));
    }
    
    @Override
    public Result<?> save(ScheduleBO bo){
        return ResultUtil.saveResult(scheduleService.save(bo));
    }
    
    @Override
    public Result<?> delete(ScheduleBO bo){
        return ResultUtil.deleteResult(scheduleService.delete(bo));
    }

    @Override
    public Result<List<ScheduleBO>> queryList(ScheduleBO bo) {
        return ResultUtil.successResult(scheduleService.queryList(bo));
    }
    
    @Override
    public Result<?> runTask(ScheduleBO bo) {
        return ResultUtil.operateResult(scheduleService.runTask(bo), "执行");
    }
    
    @Override
    public Result<?> updateStatus(ScheduleBO bo) {
        return ResultUtil.operateResult(scheduleService.updateStatus(bo), "更新");
    }

    @Override
    public Result<ScheduleBO> queryOne(ScheduleBO bo) {
        return ResultUtil.successResult(scheduleService.queryOne(bo));
    }
}
